package chapter03.Example14;

class Student14 {
    String name;
    int age;
    String school = "A 大学";

    public Student14(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public void info() {
        System.out.println("姓名：" + this.name + ",年龄：" + this.age + "，学院" + school);
    }
}

public class Example14 {
    public static void main(String[] args) {
        Student14 stu1 = new Student14("张三", 18);
        Student14 stu2 = new Student14("李四", 19);
        Student14 stu3 = new Student14("王五", 20);
        stu1.info();
        stu2.info();
        stu3.info();
        stu1.school = "B 大学";
        stu1.info();
        stu2.info();
        stu3.info();

    }
}
